package com.platform.common.utils;

import org.apache.commons.codec.digest.DigestUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.UnsupportedEncodingException;

/**
 * MD5工具类
 * @author wangjun
 *
 */
public class MD5Utils {
	
	private static final Logger log = LoggerFactory.getLogger(MD5Utils.class);
	private static final String SALT = "!@platform~&$0*nb@m1.gg";
    public static String getMd5ofStr(String inbuf) {
        try {
            inbuf = inbuf + SALT;
            return DigestUtils.md5Hex(inbuf.getBytes("utf-8"));
        } catch (UnsupportedEncodingException e) {
            log.error(e.getMessage());
            return inbuf;
        }
    }

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		System.out.println("============>"+getMd5ofStr("111111"));
	}

}
